package autowired.service;

import autowired.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{
//    @Autowired
//    private UserDao userDao;

    //属性注入 根据名称 类型注入
    @Autowired
    @Qualifier(value = "userRedisDaoImpl")  //！为类名
    private UserDao userDao;

    @Override
    public void add() {
        System.out.println("Service执行");
        userDao.add();
    }
}
